// (c) Copyright Alf P. Steinbach 2008.  Changes marked "APS".
// Use, modification and distribution are subject to the "New BSD License"
// as listed at <url: http://www.opensource.org/licenses/bsd-license.php>.
//
// <original comment>
// (C) Jonathan Turkanis.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
//
// Contains the definition of move_ptrs::default_deleter, the default
// Deleter template argument to move_ptr. Uses a technique of Daniel
// Wallin to capture the type of a pointer at the time the deleter 
// is constructed, so that move_ptrs can delete objects of incomplete 
// type by default.
// </original comment>

#ifndef ALFS_MOVE_PTRS_DELETER_HPP          // APS: Changed header guard.
#define ALFS_MOVE_PTRS_DELETER_HPP 
#include    <alfs/config.hpp>

#include <boost/checked_delete.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/remove_bounds.hpp>
#include <alfs/stdx/default_delete.hpp>     // APS: struct std::default_delete<>

namespace alfs{ namespace jt{ namespace move_ptrs{  // Changed boost::move_ptrs -> alfs::jt::move_ptrs

// APS: intricate and apparently unsafe implementation (namespace detail) removed.

template<typename T>
struct default_deleter: ::std::default_delete<T>
// APS: mpl compile time switch on array/non-array removed.
{ 
    default_deleter() { }
    template<typename TT>
    default_deleter(default_deleter<TT> tt) { }
};

} } }  // alfs::jt::move_ptrs

#endif // #ifndef ALFS_MOVE_PTRS_DELETER_HPP
